import { RMIObject } from "../../Engine/RMI/RMIObject";
import { SerializeStream } from "../../Framework/Serialize/SerializeStream";
import { SAchievementType } from "./SAchievementType";
import { Exception } from "../../Framework/Util/Exception";
//class AMI_IAchievement_getAchievementReward

export class AMI_IAchievement_getAchievementReward extends RMIObject {
  constructor(arg1?: Function, arg2?: Function, arg3?: any) {
    super(arg1, arg2);
    this.userObject = arg3;
    this.callFunction = "getAchievementReward";
    return;
  }

  public /* override */ __response(arg1: SerializeStream): void {
    var __is: SerializeStream;
    var achievementType: SAchievementType;

    var loc1;
    __is = arg1;
    try {
      achievementType = new SAchievementType();
      achievementType.__read(__is);
    } catch (__ex) {
      this.cdeException(
        new Exception(
          "ExceptionCodeSerialize",
          Exception.ExceptionCodeSerialize
        )
      );
      return;
    }
    this.cdeResponse(achievementType);
    return;
  }

  public cdeResponse(arg1: SAchievementType): void {
    if (this._response) {
      this._response.call(null, this, arg1);
    }
    return;
  }
}
